package com.feihao.demo2;

public class Role {
    private int age;
    private String name;
    //这个角色的技能：
    Skill skill;

    public Role() {
    }

    public Role(int age, String name, Skill skill) {
        this.age = age;
        this.name = name;
        this.skill = skill;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Skill getSkill() {
        return skill;
    }

    public void setSkill(Skill skill) {
        this.skill = skill;
    }

    //施放技能的方法:
    public void useSkill(){
        skill.skill();
    }
}
